package recite.word.service.base.common.request;

import java.io.Serializable;

/**
 * @program: kubayaxi_video_back
 * @description:
 * @author: Mr.lin
 * @create: 2022-12-31 23:11
 **/

public class BaseRequest<T> implements Serializable {
	private static final long serialVersionUID = 6786042125997164601L;
	private Integer pageNo = 1;
	private Integer pageSize = 10;
	private T data;

	public BaseRequest() {
		this.pageNo = 1;
		this.pageSize = 10;
	}

	public Integer getPageNo() {
		int limitStart = 0;
		if (this.pageNo != null && this.pageNo > 0) {
			limitStart = (this.pageNo - 1) * this.pageSize;
		}

		return limitStart;
	}

	public void setPageNo(Integer pageNo) {
		this.pageNo = pageNo;
	}

	public Integer getPageSize() {
		return this.pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public T getData() {
		return this.data;
	}

	public void setData(T data) {
		this.data = data;
	}

	protected boolean canEqual(final Object other) {
		return other instanceof BaseRequest;
	}

	public int hashCode() {
		int result = 1;
		Object $pageNo = this.getPageNo();
		result = result * 59 + ($pageNo == null ? 43 : $pageNo.hashCode());
		Object $pageSize = this.getPageSize();
		result = result * 59 + ($pageSize == null ? 43 : $pageSize.hashCode());
		Object $data = this.getData();
		result = result * 59 + ($data == null ? 43 : $data.hashCode());
		return result;
	}

	public String toString() {
		return "BaseRequest(pageNo=" + this.getPageNo() + ", pageSize=" + this.getPageSize() + ", data=" + this.getData() + ")";
	}
}
